package com.kfm.base.date;

import java.util.Date;

public class Demo {

    public static void main(String[] args) {
//        Date date = new Date();
//        Date date1 = new Date(System.currentTimeMillis());

        Date date = new Date(108, 9, 01);

//        date.setTime(1000L * 60 * 60 * 24 * 365);

        System.out.println(date);
        System.out.println(date.toLocaleString());
        System.out.println(date.toGMTString());

        Date date1 = new Date(1000L * 60 * 60 * 24 * 365);

        System.out.println(date.before(date1));
        System.out.println(date.after(date1));

        System.out.println(date.compareTo(date1));


        date = new Date();;

        System.out.println(date.getYear()); // 123
        System.out.println(date.getMonth()); // 7
        System.out.println(date.getDate()); // 24
        System.out.println(date.getDay()); // 4  dayOfWeek

        System.out.println(date.getHours()); // 11
        System.out.println(date.getMinutes()); // 25
        System.out.println(date.getSeconds());


    }
}
